package com.topgay.dao.chatting;

import java.util.List;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.topgay.domain.TestChatting;

@Repository
public class TestChattingDAO {

	@Autowired
	private SqlSessionTemplate session;
	
	public int insertMessage(TestChatting m_obj){
		return session.insert("chatting.insertMessage", m_obj);
	}
	
	public List<TestChatting> selectMessage(String myId){
		System.out.println(session.selectList("chatting.selectMessage", myId));
		return session.selectList("chatting.selectMessage", myId);
	}
	
	public List<TestChatting> selectAllMessage(){
		return session.selectList("chatting.selectAllMessage");
	}
}
